package com.zeji.androidadvance.activity.videolist;

import android.os.Bundle;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.viewpager2.widget.ViewPager2;
import com.zeji.androidadvance.R;

import java.util.ArrayList;
import java.util.List;

public class VideoListActivity extends AppCompatActivity {
    ViewPager2 viewPager;
    VideoListAdapter adapter;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_video_list_layout);
        viewPager = findViewById(R.id.videoListViewPager);
        adapter = new VideoListAdapter(this, viewPager);

        List<String> list = new ArrayList<>();
        for (int i = 0; i < 9; i++) {
            StringBuilder sb = new StringBuilder();
            for (int j = 0; j < 4; j++) {
                sb.append(i + 1);
            }
            list.add(sb.toString());
        }
        adapter.setValue(list);
    }
}
